import request from '@/utils/request'

// 根据手机号查询信息
export function tempPhone(query) {
  return request({
    url: '/member/member/tempPhone',
    method: 'get',
    params: query
  })
}



// 查询客户信息列表
export function listMember(query) {
  return request({
    url: '/member/member/list',
    method: 'get',
    params: query
  })
}

// 查询客户信息详细
export function getMember(id) {
  return request({
    url: '/member/member/' + id,
    method: 'get'
  })
}

// 新增客户信息
export function addMember(data) {
  return request({
    url: '/member/member',
    method: 'post',
    data: data
  })
}

// 修改客户信息
export function updateMember(data) {
  return request({
    url: '/member/member',
    method: 'put',
    data: data
  })
}

// 删除客户信息
export function delMember(id) {
  return request({
    url: '/member/member/' + id,
    method: 'delete'
  })
}

// 导出客户信息
export function exportMember(query) {
  return request({
    url: '/member/member/export',
    method: 'get',
    params: query
  })
}
// 查询可发放优惠券
export function canUseCoupons(params) {
  return request({
    url: '/member/member/canUseCoupons',
    method: 'post',
    params
  })
}

//获取vip用户列表
export function getVipList(query) {
  return request({
    url: '/admin/memberVip/list',
    method: 'get',
    params: query
  })
}

//获取vip用户详情
export function getVipDetail(id) {
  return request({
    url: '/admin/memberVip/'+id,
    method: 'get'
  })
}

//获取会员价格
export function getVipPrice() {
  return request({
    url: '/admin/memberVip/getConfigVip',
    method: 'get'
  })
}

//修改会员价格
export function updateVipPrice(data) {
  return request({
    url: '/admin/memberVip/editConfig',
    method: 'post',
    data
  })
}

//获取会员权益配置
export function getMemberConfig() {
  return request({
    url: '/member/member/getConfig',
    method: 'get'
  })
}

//修改会员权益
export function updateMemberConfig(data) {
  return request({
    url: '/member/member/editConfig',
    method: 'post',
    data
  })
}